package cycling.taxi.com.ui.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import cycling.taxi.com.R;
import cycling.taxi.com.entity.CommonQuestion;
import cycling.taxi.com.entity.Tips;
import cycling.taxi.com.person.ExitApplication;
import cycling.taxi.com.utils.ToastUtil;
import cycling.taxi.com.utils.Urls;

public class AutofixItem extends AppCompatActivity implements View.OnClickListener{
    private TextView title;
    private ImageView back;
    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_autofix_item);
        ExitApplication.getInstance().addActivity(this);
        initView();
        initData();
        initLinstener();
        }
    public void initView(){
        title=(TextView)findViewById(R.id.title_text);
        back=(ImageView) findViewById(R.id.back);
        webView=(WebView)findViewById(R.id.webView);
    }
    public void initData(){
        CommonQuestion commonQuestion=(CommonQuestion)getIntent().getSerializableExtra("CommonQuestion");
        webView.loadUrl(Urls.getReparByselfItem()+"?common_id="+commonQuestion.getId());
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return super.shouldOverrideUrlLoading(view, url);
            }
        });
        title.setText("常见问题");
    }
    public void initLinstener(){
        back.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        if (v.getId()==R.id.back){
            finish();
        }
    }
    }
